<template>
	<div>
		<h1>Vue2的home</h1>
		<hr />
		{{ str }}
		<hr />
		computed:{{ changeStr }}
		<hr />
		<input type="" name="" v-model="changeStr" />
	</div>
</template>

<script type="text/javascript">
export default {
	data() {
		return {
			str: '这是一个数据'
		};
	},
	computed: {
		changeStr: {
			get() {
				return 1 + this.str;
			},
			set(val) {
				this.str = val;
			}
		}
	}
};
</script>

<style></style>
